<template>
	<div style="display: flex;flex-direction: column;" class="otherPage partyBuildingLeads partyBuildingInNewsList">
		<Header :selected="2"></Header>
		<div class="bannerArea">
			<div class="banner" :style="bg_img? 'background:url('+bg_img+') no-repeat;background-size:cover;':''">
			</div>
		</div>
		<Navigation v-loading="loading" :items="breadcrumbItems" :menus="menus" :bgColor="bgColor" :checked="2">
		</Navigation>
		<div class="content" style="min-height: 600px;">
			<div class="content_bg" style="min-height: 600px;">
				<el-row>
					<el-col class="partyBuildingInNewsTitle">
						{{newsData.title}}
					</el-col>
					<el-col class="partyBuildingInNewsDate">
						{{$t("releaseDate")}}{{newsData?"："+(newsData.createTime||''):""}}
					</el-col>
					<!-- <el-col class="partyBuildingInNewsDescription">
					 
						<img :src="newsData.coverImage" style="object-fit: cover;width: 100%; height:70vh;" />
					</el-col> -->
					<el-col class="partyBuildingInNewsDescription"
						v-html="newsData.content?newsData.content.setWrap():''">
					</el-col>
				</el-row>
			</div>
		</div>
		<Footer></Footer>
	</div>
</template>

<script>
	import Header from '../../../src/components/common/header/Header.vue'
	import Navigation from '../../../src/components/common/navigation/Navigation.vue'
	import Footer from '../../../src/components/common/footer/Footer.vue'
	import Pagination from '../../../src/components/common/Pagination.vue'
	import {
		partyBuildingLeads
	} from '../../utils/menu.js'
	export default {
		components: {
			Header,
			Navigation,
			Footer,
			Pagination
		},
		data() {
			return {
				loading: true,
				bg_img: '', //头部banner，默认值已绑定，有背景自动切换
				bgColor: "white", //white/red
				pageSize: 4,
				total: 1000,
				currentPage: 1,
				memberActivityId: '',
				menus: partyBuildingLeads,
				breadcrumbItems: [{
						//首页
						label: this.$t('home'),
						to: '/home'
					},
					{
						//党建引领
						label: this.$t('partyBuildingLeads'),
						to: '/partyBuildingLeads'
					},
					{
						//党建资讯
						label: this.$t('partyMemberActivities'),
						to: '/partyMemberActivities'
					}
				],
				newsCarousel: [{
						imageUrl: 'https://www-file.huawei.com/-/media/corp2020/home/banner/8/mate-x5.jpg',
						title: '11111111111111111111111111111'

					},
					{
						imageUrl: 'https://www-file.huawei.com/-/media/corp2020/home/banner/8/vmall-0925-new-p.jpg',
						title: '222222222222222222222222222222'

					}, {
						imageUrl: 'https://www-file.huawei.com/-/media/corp2020/home/banner/8/mbbf2023-cn2.jpg',
						title: '3333333333333333333333333333'

					}
				],

				newsData: {
					coverImage: '',
					createTime: '',
					title: ''
				},


				hoverIndex: -1
			};
		},
		computed: {},
		created() {},
		mounted() {
			this.getMemberActivityTopImage();
			this.memberActivityId = this.$route.query.memberActivityId;
			this.getMemberActivityDetail().then(i => {
				this.$request.setImageMaxwidth("img");
			});
		},
		methods: {
			getMemberActivityDetail() {
				return new Promise((resolve, reject) => {
					let params = {
						"memberActivityId": this.memberActivityId, //党建资讯id
					};
					let that = this;
					that.$request.getMemberActivityDetail(params).then(res => {
							if (res && res.data) {
								that.newsData = res.data;
							}
							this.loading = false;
							resolve();
						})
						.catch((error) => {
							console.log(error);
						})
				});
			},
			getMemberActivityTopImage() {
				let params = {};
				let that = this;
				that.$request.getMemberActivityTopImage(params).then(res => {
					if (res && res.data) {
						that.bg_img = res.data.fileUrl;
					}
					this.loading = false;
				}).catch((error) => {
					console.log(error);
				});
			},
		}
	}
</script>

<style scoped>
	@import url("../../components/common/css/partyBuildingLeads/partyBuildingLeads.css");

	.partyBuildingInNewsTitle {
		height: max-content;
		line-height: 40px;
		font-size: 20px;
		text-align: center;
		font-weight: 530;
		color: #333333;
	}

	.partyBuildingInNewsDate {
		text-align: center;
		height: 40px;
		line-height: 40px;
		font-weight: 400;
		color: #999999;
		line-height: 33px;
	}

	.partyBuildingInNewsDescription {
		font-weight: 400;
		color: #666666;
		line-height: 27px;
	}

	.partyBuildingInNewsDescription img {
		max-width: 100% !important;
	}

	.partyBuildingLeads .content {
		padding: 0;
	}

	.content_bg {
		margin: 0px auto;
		padding: 50px;

	}

	@media (min-width: 2560px) {
		.content_bg {
			width: calc(2560px * 0.8);
		}
	}

	@media (max-width: 2560px) {
		.content_bg {
			width: calc(2560px * 0.8);
		}
	}

	@media (max-width: 2320px) {
		.content_bg {
			width: calc(2320px * 0.8);
		}
	}

	@media (max-width: 2120px) {
		.content_bg {
			width: calc(2120px * 0.8);
		}
	}

	@media (max-width: 1920px) {
		.content_bg {
			width: calc(1920px * 0.8);
		}

		.companyCultureImgArea {
			width: 60%;
		}

		.companyCultureContent {}

	}

	@media (max-width: 1720px) {


		.content_bg {
			width: calc(1720px * 0.8);
		}
	}

	@media (max-width: 1520px) {
		.content_bg {
			width: calc(1520px * 0.8);
		}
	}

	@media (max-width: 1366px) {
		.content_bg {
			width: calc(1366px * 0.8);
		}
	}

	@media (max-width: 1120px) {
		.content_bg {
			width: 100%
		}
	}

	@media (max-width: 1024px) {}

	@media (max-width: 900px) {}
</style>
